package org.bee;

import org.bee.model.result.Page;

/**
 * 分页线程变量
 */
public class PageUtil {
    private static final ThreadLocal<Page> PAGE_THREAD_LOCAL = new ThreadLocal<>();
    public static void setPage(Long current,Long size){
        Page page = new Page();
        page.setCurrent(current);
        page.setSize(size);
        PAGE_THREAD_LOCAL.set(page);
    }

    public static Page getPage(){
        return PAGE_THREAD_LOCAL.get();
    }

    public static void clearPage(){
        PAGE_THREAD_LOCAL.remove();
    }
}
